package com.ruoyi.hanyun.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 任务对象 hy_task
 */
public class HyTasks extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 任务ID
     */
    private Long id;

    /**
     * 所属项目ID
     */
    @Excel(name = "所属项目ID")
    private Long projectId;

    /**
     * 父任务ID
     */
    @Excel(name = "父任务ID")
    private Long parentId;

    /**
     * 任务名称
     */
    @Excel(name = "任务名称")
    private String name;

    /**
     * 任务描述
     */
    @Excel(name = "任务描述")
    private String description;

    /**
     * 负责人ID
     */
    @Excel(name = "负责人ID")
    private Long ownerId;

    /**
     * 优先级
     */
    @Excel(name = "优先级", readConverterExp = "LOW=低,MEDIUM=中,HIGH=高")
    private String priority;

    /**
     * 状态
     */
    @Excel(name = "状态", readConverterExp = "NOT_STARTED=未开始,IN_PROGRESS=进行中,BLOCKED=阻塞,COMPLETED=已完成")
    private String status;

    /**
     * 计划开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /**
     * 计划结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /**
     * 实际开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualStartDate;

    /**
     * 实际结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualEndDate;

    /**
     * 预估工时
     */
    @Excel(name = "预估工时")
    private BigDecimal estimatedHours;

    /**
     * 实际工时
     */
    @Excel(name = "实际工时")
    private BigDecimal actualHours;

    /**
     * 进度百分比
     */
    @Excel(name = "进度百分比")
    private Integer progress;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;


    /**
     * 子任务列表
     */
    private List<HyTasks> children;

    /**
     * 依赖的任务ID列表
     */
    private List<Long> dependsOnTaskIds;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public void setOwnerId(Long ownerId) {
        this.ownerId = ownerId;
    }

    public Long getOwnerId() {
        return ownerId;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public String getPriority() {
        return priority;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setActualStartDate(Date actualStartDate) {
        this.actualStartDate = actualStartDate;
    }

    public Date getActualStartDate() {
        return actualStartDate;
    }

    public void setActualEndDate(Date actualEndDate) {
        this.actualEndDate = actualEndDate;
    }

    public Date getActualEndDate() {
        return actualEndDate;
    }

    public void setEstimatedHours(BigDecimal estimatedHours) {
        this.estimatedHours = estimatedHours;
    }

    public BigDecimal getEstimatedHours() {
        return estimatedHours;
    }

    public void setActualHours(BigDecimal actualHours) {
        this.actualHours = actualHours;
    }

    public BigDecimal getActualHours() {
        return actualHours;
    }

    public void setProgress(Integer progress) {
        this.progress = progress;
    }

    public Integer getProgress() {
        return progress;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public List<HyTasks> getChildren() {
        return children;
    }

    public void setChildren(List<HyTasks> children) {
        this.children = children;
    }

    public List<Long> getDependsOnTaskIds() {
        return dependsOnTaskIds;
    }

    public void setDependsOnTaskIds(List<Long> dependsOnTaskIds) {
        this.dependsOnTaskIds = dependsOnTaskIds;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("projectId", getProjectId())
                .append("parentId", getParentId())
                .append("name", getName())
                .append("description", getDescription())
                .append("ownerId", getOwnerId())
                .append("priority", getPriority())
                .append("status", getStatus())
                .append("startDate", getStartDate())
                .append("endDate", getEndDate())
                .append("actualStartDate", getActualStartDate())
                .append("actualEndDate", getActualEndDate())
                .append("estimatedHours", getEstimatedHours())
                .append("actualHours", getActualHours())
                .append("progress", getProgress())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .toString();
    }
}